package com.autonavi.abs.common.base;

import java.util.Date;

/**
 * @author wwy
 * @version V1.0
 * <p>Description: 查询基类</p>
 * @date 2020-07-20 22:17
 */

public class BaseQuery {

    /**
     * 第几页
     */
    protected Integer pageIndex = 1;
    /**
     * 每页多少条
     */
    protected Integer pageSize = 10;

    /**
     * 分页取多少条
     */
    protected Integer limit = 10;
    /**
     * 偏移量
     */
    protected Integer offset = 0;
    /**
     * 开始时间
     */
    protected Date startTime;
    /**
     * 结束时间
     */
    protected Date endTime;
    /**
     * 是否删除，默认查询不删除的数据
     */
    protected Integer deleted = 0;

    /**
     * 排序字段
     */
    protected String orderBy;

    /**
     * 排序类型
     */
    protected String orderType = "desc";

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    public Integer getOffset() {
        return offset;
    }

    public void setOffset(Integer offset) {
        this.offset = offset;
    }

    public String getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(String orderBy) {
        this.orderBy = orderBy;
    }

    public String getOrderType() {
        return orderType;
    }

    public void setOrderType(String orderType) {
        this.orderType = orderType;
    }

    public Integer getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(Integer pageIndex) {
        this.pageIndex = pageIndex;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }
    public void disablePage(){
        this.limit = null;
        this.offset = null;
    }
}
